import { getInitialFieldsValue } from '@/pages/supplier/utils'
import { SUPPLIER_CATEGORY_SELECT_LIST } from '@/pages/supplier/constants/common'

// 供应商管理 - 供应商海量库
const FORM_ITEM_LIST = [
  { prop: 'supplierCode', label: '供应商代码', type: 'input', },
  { prop: 'supplierName', label: '供应商名称', type: 'input', },
  { prop: 'mainCategoryId', label: '主营品类', type: 'categorySelect', },
  { prop: 'managementAreaId', label: '管理区域', type: 'managementArea', },
  { prop: 'businessConnectorName', label: '业务对接人', type: 'input', },
  { prop: 'mainProduct', label: '主营商品', type: 'input', },
  { prop: 'lastYearAmount', label: '去年进货额', type: 'numberRange', startPlaceholder: '请输入进货金额', endPlaceholder: '请输入进货金额', },
  { prop: 'yearAmount', label: '本年度进货额', type: 'numberRange', startPlaceholder: '请输入进货金额', endPlaceholder: '请输入进货金额', },
  { prop: 'createTime', label: '创建日期', type: 'datePicker', },
  { prop: 'brandName', label: '合作品牌', type: 'brandName', },
  {
    prop: 'belongDepartment',
    label: '归属中心',
    required: true,
    type: 'select',
    filterable: true,
    dict: 233,
  },
  {
    prop: 'supplierClassify',
    label: '供应商分类',
    type: 'select',
    clearable: true,
    options: SUPPLIER_CATEGORY_SELECT_LIST
  },
]
const INITIAL_FIELDS_VALUE = getInitialFieldsValue(FORM_ITEM_LIST)

const TABLE_COLUMNS = [
  { title: '序号', key: 'index', width: 50 },
  { title: '供应商代码', key: 'supplierCode', width: 90 },
  { title: '供应商名称', key: 'supplierName', width: 200 },
  { title: '供应商分类', key: 'supplierClassifyName', width: 90 },
  { title: '供应商类型', key: 'supplierTypeName', width: 90 },
  { title: '主营品类代码', key: 'mainCategoryCode' },
  { title: '主营品类', key: 'mainCategory' },
  { title: '主营商品', key: 'mainProduct', width: 150 },
  { title: '合作品牌', key: 'brandName', width: 150 },
  { title: '归属中心', key: 'belongDepartmentName', width: 100 },
  { title: '管理区域', key: 'supplierManagerAreaName', width: 120 },
  { title: '业务对接人', key: 'businessContactName', width: 100 },
  { title: '去年进货额', key: 'lastYearPurchaseAmount', width: 100 },
  { title: '本年进货额', key: 'yearPurchaseAmount', width: 100 },
  { title: '创建日期', key: 'createTime', width: 160 }
]
export {
  INITIAL_FIELDS_VALUE,
  FORM_ITEM_LIST,
  TABLE_COLUMNS
}
